# -*- coding:utf-8 -*-
import time
import os

def charge_acc():
    company = raw_input("交易对象：")
    income = raw_input("收入/万：")
    disbursement = raw_input("支出/万：")
    ar = raw_input("应收账款/万：")
    ap = raw_input("应出账款/万：")
    date = time.strftime("%Y年%m月%d日",time.localtime())

    result = "%s\t%s\t%s\t%s\t%s\t%s\n" %(company, income, disbursement, ar, ap,date)
    f = open("general_journal.txt","a+")
    f.write(result)
    f.close()


def check_acc():
    print "查账模式"
    print "1.查询最近十笔交易记录\n2.查询与某公司交易往来\n3.查询最近资产负债状况"
    option = raw_input("请选择服务：")
    if option == "1":
        check_recent()
    elif option == "2":
        check_company()
    elif option == "3":
        check_balance()


def check_recent():
    if os.path.exists('general_journal.txt'):
        f = open('general_journal.txt','r')



def check_company(comp):
    pass


def check_balance():
    pass


print "1.查账；2.记账"
choice = raw_input("请选择服务：")
if choice == "1":
    check_acc()
elif choice == "2":
    charge_acc()


